package com.lxb.demo3

import org.apache.flink.streaming.api.scala._
import org.apache.flink.table.api.bridge.scala.StreamTableEnvironment;
import org.apache.flink.table.api.Expressions.$

/**
 * @author: albert
 * @date: 2021/5/28 11:31
 * @description:
 */
object TableApiTest3 {
  def main(args: Array[String]): Unit = {

    val env: StreamExecutionEnvironment = StreamExecutionEnvironment.getExecutionEnvironment

    val tableEnv: StreamTableEnvironment = StreamTableEnvironment.create(env)

    val dataStream: DataStream[(String, String)] = env.fromElements(("tom", "12"), ("sam", "23"))

    tableEnv.fromDataStream(dataStream, $("UserActionTimestamp"),
      $("user_name"), $("data"), $("user_action_time").proctime)



  }
}
